package org.hy.framework.spring.hibernate3.dao;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import org.hy.framework.spring.hibernate3.entity.Cat;

public class TT {

	/**
	 * 
	 * <ul>
	 * <li>方法含义：</li>
	 * <li>方法作者：花宏宇</li>
	 * <li>编写日期：2013-5-16；时间：下午4:11:54</li>
	 * </ul>
	 * <ul>
	 * <b>修订编号：</b>
	 * <li>修订日期：</li>
	 * <li>修订作者：</li>
	 * <li>修订原因：</li>
	 * <li>修订内容：</li>
	 * </ul>
	 * @param args
	 * @return 
	 */
	public static void main(String[] args) {
		Class entityClass = Cat.class;
		Cat cat = new Cat();cat.setId(99);
		Method method;
		try {
			method = entityClass.getMethod("getId");
		
		Object reObject;
		
			reObject = method.invoke(cat );
			System.err.println(reObject);

		} catch (IllegalArgumentException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InvocationTargetException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SecurityException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (NoSuchMethodException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
